
//Copyright 1997-2009 Syrinx Development, Inc.
//This file is part of the Syrinx Web Application Framework (SWAF).
// == BEGIN LICENSE ==
//
// Licensed under the terms of any of the following licenses at your
// choice:
//
//  - GNU General Public License Version 3 or later (the "GPL")
//    http://www.gnu.org/licenses/gpl.html
//
//  - GNU Lesser General Public License Version 3 or later (the "LGPL")
//    http://www.gnu.org/licenses/lgpl.html
//
//  - Mozilla Public License Version 1.1 or later (the "MPL")
//    http://www.mozilla.org/MPL/MPL-1.1.html
//
// == END LICENSE ==
using System;


namespace Swaf.BizRule
{
	/// <summary>
	/// Maintains a collection of bizrules that can be executed through it.
	/// </summary>
	public interface IRuleGroup : IRuleExecutor, IResults
	{
		IInitialRequest MainRequest {get;}
		int TotalRules {get;}
		int RulesCompletedCount {get;}

		IRuleGroup createChildGroup(bool maintainResults);

		void pauseExecution();
		void continueExecution();
		void cancelExecution();

		/// <summary>
		/// Waits for all child rules to complete.
		/// </summary>
		/// <param name="deepWait">When true, this wait will not return until all child sub groups are done.  When false
		/// this will return when the immediate children are done, even if other rules further down the parent/child chain are
		/// still running.</param>
		void waitForCompletion(bool deepWait);
	}
}
